package com.tbfs.admin.service.sdk.impl;

import java.util.List;

import com.tbfs.admin.dao.UserinfoDAO;
import com.tbfs.admin.service.sdk.IUserInfoService;
import com.tbfs.admin.vo.UserRole;
import com.tbfs.admin.vo.Userinfo;

public class UserInfoServiceImpl implements IUserInfoService{
	
	private UserinfoDAO userinfoDao;
	
	public UserinfoDAO getUserinfoDao() {
		return userinfoDao;
	}

	public void setUserinfoDao(UserinfoDAO userinfoDao) {
		this.userinfoDao = userinfoDao;
	}

	public Userinfo getUserInfo(Userinfo bean) {
		// TODO Auto-generated method stub
		return userinfoDao.getLoginUserInfo(bean);
	}
	
	public int modify(Userinfo userinfo){
		 return userinfoDao.updateByPrimaryKeySelective(userinfo);
	}
	
	public void add(Userinfo userinfo){
		userinfoDao.insert(userinfo);
	}
	
	public void destory(Userinfo userinfo){
		userinfoDao.deleteByPrimaryKey(userinfo);
	}

	public void addUserRole(UserRole userRole) {
		userinfoDao.insertUserRole(userRole);
	}

	public List getUserInfoList(Userinfo bean) {
		return userinfoDao.queryBySelective(bean);
	}

	public Integer getUserInfoTotalRows(Userinfo bean) {
		// TODO Auto-generated method stub
		return userinfoDao.queryCountBySelective(bean);
	}

	public List getUserRoleList(UserRole userRole) {
		// TODO Auto-generated method stub
		return userinfoDao.queryUserRoleList(userRole);
	}
}
